Optimal. Leaf size=91 \[ \frac {a (B+i A) \tan ^2(c+d x)}{2 d}+\frac {a (A-i B) \tan (c+d x)}{d}+\frac {a (B+i A) \log (\cos (c+d x))}{d}-a x (A-i B)+\frac {i a B \tan ^3(c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.11, antiderivative size = 91, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3592, 3528, 3525, 3475} \[ \frac {a (B+i A) \tan ^2(c+d x)}{2 d}+\frac {a (A-i B) \tan (c+d x)}{d}+\frac {a (B+i A) \log (\cos (c+d x))}{d}-a x (A-i B)+\frac {i a B \tan ^3(c+d x)}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3525
Rule 3528
Rule 3592
Rubi steps
\begin {align*} \int \tan ^2(c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx &=\frac {i a B \tan ^3(c+d x)}{3 d}+\int \tan ^2(c+d x) (a (A-i B)+a (i A+B) \tan (c+d x)) \, dx\\ &=\frac {a (i A+B) \tan ^2(c+d x)}{2 d}+\frac {i a B \tan ^3(c+d x)}{3 d}+\int \tan (c+d x) (-a (i A+B)+a (A-i B) \tan (c+d x)) \, dx\\ &=-a (A-i B) x+\frac {a (A-i B) \tan (c+d x)}{d}+\frac {a (i A+B) \tan ^2(c+d x)}{2 d}+\frac {i a B \tan ^3(c+d x)}{3 d}-(a (i A+B)) \int \tan (c+d x) \, dx\\ &=-a (A-i B) x+\frac {a (i A+B) \log (\cos (c+d x))}{d}+\frac {a (A-i B) \tan (c+d x)}{d}+\frac {a (i A+B) \tan ^2(c+d x)}{2 d}+\frac {i a B \tan ^3(c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.88, size = 86, normalized size = 0.95 \[ \frac {a \left (-6 (A-i B) \tan ^{-1}(\tan (c+d x))+3 (B+i A) \tan ^2(c+d x)+6 (A-i B) \tan (c+d x)+6 (B+i A) \log (\cos (c+d x))+2 i B \tan ^3(c+d x)\right )}{6 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.51, size = 164, normalized size = 1.80 \[ \frac {{\left (12 i \, A + 18 \, B\right )} a e^{\left (4 i \, d x + 4 i \, c\right )} + {\left (18 i \, A + 18 \, B\right )} a e^{\left (2 i \, d x + 2 i \, c\right )} + {\left (6 i \, A + 8 \, B\right )} a + {\left ({\left (3 i \, A + 3 \, B\right )} a e^{\left (6 i \, d x + 6 i \, c\right )} + {\left (9 i \, A + 9 \, B\right )} a e^{\left (4 i \, d x + 4 i \, c\right )} + {\left (9 i \, A + 9 \, B\right )} a e^{\left (2 i \, d x + 2 i \, c\right )} + {\left (3 i \, A + 3 \, B\right )} a\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )}{3 \, {\left (d e^{\left (6 i \, d x + 6 i \, c\right )} + 3 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.60, size = 284, normalized size = 3.12 \[ \frac {3 i \, A a e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 3 \, B a e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 9 i \, A a e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 9 \, B a e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 9 i \, A a e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 9 \, B a e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 12 i \, A a e^{\left (4 i \, d x + 4 i \, c\right )} + 18 \, B a e^{\left (4 i \, d x + 4 i \, c\right )} + 18 i \, A a e^{\left (2 i \, d x + 2 i \, c\right )} + 18 \, B a e^{\left (2 i \, d x + 2 i \, c\right )} + 3 i \, A a \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 3 \, B a \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 6 i \, A a + 8 \, B a}{3 \, {\left (d e^{\left (6 i \, d x + 6 i \, c\right )} + 3 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.02, size = 141, normalized size = 1.55 \[ \frac {i a B \left (\tan ^{3}\left (d x +c \right )\right )}{3 d}+\frac {i a A \left (\tan ^{2}\left (d x +c \right )\right )}{2 d}-\frac {i a B \tan \left (d x +c \right )}{d}+\frac {a B \left (\tan ^{2}\left (d x +c \right )\right )}{2 d}+\frac {a A \tan \left (d x +c \right )}{d}-\frac {i a \ln \left (1+\tan ^{2}\left (d x +c \right )\right ) A}{2 d}-\frac {a \ln \left (1+\tan ^{2}\left (d x +c \right )\right ) B}{2 d}+\frac {i a B \arctan \left (\tan \left (d x +c \right )\right )}{d}-\frac {a A \arctan \left (\tan \left (d x +c \right )\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.75, size = 82, normalized size = 0.90 \[ -\frac {-2 i \, B a \tan \left (d x + c\right )^{3} - {\left (3 i \, A + 3 \, B\right )} a \tan \left (d x + c\right )^{2} + 6 \, {\left (d x + c\right )} {\left (A - i \, B\right )} a + 3 \, {\left (i \, A + B\right )} a \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - 6 \, {\left (A - i \, B\right )} a \tan \left (d x + c\right )}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 6.11, size = 82, normalized size = 0.90 \[ \frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (\frac {B\,a}{2}+\frac {A\,a\,1{}\mathrm {i}}{2}\right )}{d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (B\,a+A\,a\,1{}\mathrm {i}\right )}{d}+\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (A\,a-B\,a\,1{}\mathrm {i}\right )}{d}+\frac {B\,a\,{\mathrm {tan}\left (c+d\,x\right )}^3\,1{}\mathrm {i}}{3\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 0.66, size = 175, normalized size = 1.92 \[ \frac {i a \left (A - i B\right ) \log {\left (e^{2 i d x} + e^{- 2 i c} \right )}}{d} + \frac {6 A a - 8 i B a + \left (18 A a e^{2 i c} - 18 i B a e^{2 i c}\right ) e^{2 i d x} + \left (12 A a e^{4 i c} - 18 i B a e^{4 i c}\right ) e^{4 i d x}}{- 3 i d e^{6 i c} e^{6 i d x} - 9 i d e^{4 i c} e^{4 i d x} - 9 i d e^{2 i c} e^{2 i d x} - 3 i d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________